package com.hellogood.yaohuo.client.basic;

import com.google.gwt.i18n.client.NumberFormat;
import com.smartgwt.client.widgets.grid.CellFormatter;
import com.smartgwt.client.widgets.grid.ListGridRecord;

public class MoneyCellFormatter implements CellFormatter {

	public String format(Object value, ListGridRecord record, int rowNum, int colNum) {
		if (value == null)
			return null;
		NumberFormat nf = NumberFormat.getFormat("#,##0.0000");
		try {
			return nf.format(((Number) value).floatValue());
		} catch (Exception e) {
			return value.toString();
		}
	}
}